import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:xuance/page/add_field_filter/binding.dart';
import 'package:xuance/page/add_field_filter/view.dart';
import 'package:xuance/page/ban_ip_list/binding.dart';
import 'package:xuance/page/ban_ip_list/view.dart';
import 'package:xuance/page/login/login_binding.dart';
import 'package:xuance/page/login/login_view.dart';
import 'package:xuance/page/main/binding.dart';
import 'package:xuance/page/main/view.dart';
import 'package:xuance/page/splash/splash_binding.dart';
import 'package:xuance/page/splash/splash_view.dart';
import 'package:xuance/page/splunk_detail_list/binding.dart';
import 'package:xuance/page/splunk_detail_list/view.dart';
import 'package:xuance/page/warning_detail/binding.dart';
import 'package:xuance/page/warning_detail/view.dart';

import 'RoutePath.dart';

EventBus eventBus = EventBus();
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
        title: 'Secure Pulse Insight',
        builder: EasyLoading.init(),
        theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
            useMaterial3: true),
        getPages: [
          GetPage(
              name: RoutePath.login,
              page: () => const LoginPage(),
              binding: LoginBinding()),
          GetPage(
              name: RoutePath.splash,
              page: () => const SplashPage(),
              binding: SplashBinding()),
          GetPage(
              name: RoutePath.home,
              page: () => const MainPage(),
              binding: MainBinding()),
          GetPage(
              name: RoutePath.addFieldFilter,
              page: () => const AddFieldFilterPage(),
              binding: AddFieldFilterBinding()),
          GetPage(
              name: RoutePath.warningDetail,
              page: () => const WarningDetailPage(),
              binding: WarningDetailBinding()),
          GetPage(
              name: RoutePath.banIpList,
              page: () => const BanIpListPage(),
              binding: BanIpListBinding()),
          GetPage(
              name: RoutePath.splunkDetailList,
              page: () => const SplunkDetailListPage(),
              binding: SplunkDetailListBinding()),
        ],
        initialRoute: RoutePath.splash);
  }
}
